package com.jb.framework.pm;

import com.jb.framework.Persistable;
import com.jb.framework.PersistentDescriptor; 
import com.jb.framework.database.Predicate;

import java.util.List;

public interface MetadataLoader  {
    public boolean isReadOnly() throws PersistencyException;

    public void create(Persistable bean) throws PersistencyException;

    public void delete(Persistable bean) throws PersistencyException;

    public void delete(Class childClass, 
                       Predicate predicate) throws PersistencyException;


    public boolean exists(Class clazz);

    public List find(Class childClass, 
                     Predicate predicate) throws PersistencyException;

    public List find(Class childClass, String stmt, 
                     Predicate predicate) throws PersistencyException;

    public List find(Class childClass, Predicate predicate, 
                     long limits) throws PersistencyException;

    public Object findById(Class childClass, 
                           Object id) throws PersistencyException;

    public boolean load(Persistable bean) throws PersistencyException;

    public void save(Persistable bean) throws PersistencyException;

    public void save(Persistable bean, 
                     boolean saveChildren) throws PersistencyException;    
}
